#include<stdio.h>
#define cent 1
#define nickel 5
#define dime 10
#define quarter 25
int main(int argc, char const *argv[])
{
    int t,may, a, b, c, d;
    scanf("%d", &t);
    for (int  i = 0; i < t; i++)
    {
        a = 0, b = 0, c = 0, d = 0;
        scanf("%d", &may);
        d = may / quarter;
        may = may - d * quarter;
        c = may / dime;
        may = may - c * dime;
        b = may / nickel;
        may = may - b * nickel;
        a = may / cent;
        printf("%d quarter(s), %d dime(s), %d nickel(s), %d cent(s)\n",d,c,b,a);
    }
    return 0;
}
